package oop.core.view;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

/**
 * Game Panel is the main panel for the game.
 * It holds all the other panels and lays them out.
 *
 */
public class GamePanel extends SizeablePanel {

	public static String ID = "GAME_PANEL";
	private static final Dimension SIZE = new Dimension(1000, 800);
	private static final Point LOCATION = new Point(0, 0);

	private AreaPanel areaPanel;
	private StatsPanel statsPanel;
	private SkillsPanel skillsPanel;
	private InventoryPanel inventoryPanel;
	private EquipmentPanel equipmentPanel;
	
	/**
	 * Constructor takes all the panels and lays them out.
	 * @param areaPanel
	 * @param statsPanel
	 * @param skillsPanel
	 * @param inventoryPanel
	 * @param equipmentPanel
	 * @param terminal
	 */
	public GamePanel(AreaPanel areaPanel, StatsPanel statsPanel, SkillsPanel skillsPanel, InventoryPanel inventoryPanel, EquipmentPanel equipmentPanel, Terminal terminal)
	{
		super(LOCATION, SIZE);
		this.areaPanel = areaPanel;
		this.statsPanel = statsPanel;
		this.skillsPanel = skillsPanel;
		this.inventoryPanel = inventoryPanel;
		this.equipmentPanel = equipmentPanel;
		
		add(areaPanel);
		add(statsPanel);
		add(skillsPanel);
		add(inventoryPanel);
		add(equipmentPanel);
		add(terminal);
	}
	
	/**
	 * Renders screen.
	 */
	protected void paintComponent(Graphics g)
	{
//		System.out.println("Painting GamePanel");
		Component[] components = getComponents();
		for(Component c : components)
		{
//			System.out.println("Repainting a component from GamePanel");
			c.repaint();
		}
	}
}
